<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户信息</title>
    <style>
        nav {
            background-color: #f2f2f2;
            padding: 10px 0;
            text-align: center;
        }

        nav a {
            padding: 14px 20px;
            text-decoration: none;
            color: black;
            display: inline-block;
            cursor: pointer; /* 添加鼠标指针样式，让链接看起来可点击 */
        }

        nav a:hover {
            background-color: #ddd;
        }

        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropbtn {
            padding: 14px 20px;
            text-decoration: none;
            color: black;
            cursor: pointer; /* 添加鼠标指针样式，让链接看起来可点击 */
        }

        .dropdown-content {
            display: none;
            position: absolute;
            background-color: #f9f9f9;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
            z-index: 1;
        }

        .dropdown:hover .dropdown-content {
            display: block;
        }

        .dropdown-content a {
            color: black;
            padding: 12px 16px;
            text-decoration: none;
            display: block;
            cursor: pointer; /* 添加鼠标指针样式，让链接看起来可点击 */
        }

        .dropdown-content a:hover {
            background-color: #f1f1f1;
        }
    </style>
</head>
<body>
<nav>
    <a href="/user/adminhome">首页</a>
    <div class="dropdown">
        <a class="dropbtn">用户管理</a>
        <div class="dropdown-content">
            <a href="/user/searchUser" id="groupLink">用户管理</a>
            <a href="/user/setting" id="chatLink">新增用户</a>
        </div>
    </div>
    <div class="dropdown">
        <a class="dropbtn">个人中心</a>
        <div class="dropdown-content">
            <a href="/page/toAdminCenterPage" id="profileLink">个人资料</a>
            <a href="/page/Exit">登出</a>
        </div>
    </div>
    <a href="/page/toDataPage">数据报表</a>
</nav>
<table>
    <tr>
        <th>用 户 名</th>
        <th>用户密码</th>
        <th>角    色</th>
    </tr>
    <c:forEach var="user" items="${users}">
        <tr>
            <td><c:out value="${user.username}" /></td>
            <td><c:out value="${user.password}" /></td>
            <td><c:out value="${user.role}" /></td>
            <td><a href="<c:url value='/user/updateUser/${user.username}' />">编辑用户</a></td>
            <td><a href="<c:url value='/user/deleteUser/${user.username}' />">删除用户</a></td>
        </tr>
    </c:forEach>

</table>
</body>
</html>